All Questions
Tagged with c++17performance
36 questions
6votes
3answers
212views
Find the number of cycles of length 3
Given the count. Find the number of cycles of length 3. Input format: The first line contains two integers n and m (1 < n, m ≤ 3✕10⁵) — the number of vertices and edges, respectively. Each of the ...
2votes
1answer
209views
OrderBook Implementation - Follow up
This is a follow up to my previous implementation: The input is of the format ...
7votes
1answer
2kviews
String literals concatenation with support for dynamic strings
I have implemented a function to concatenate string literals at compile time. Basic requirements: Very simple API. Can be used as a one-liner. Must accept variadic string literals. Highly optimized ...
4votes
1answer
496views
Yet another sparse set implementation
I got inspired by this blog post and implemented a fixed-size sparse set, removing the need for vectors, because the sparse set's size equals at least ...
5votes
5answers
976views
Palindrome Permutation string
I’m starting to learn C++ by doing a lot of exercises, and I need your help so I can improve, Here is how it goes, I will try to solve an exercise and post both the ...
4votes
2answers
403views
Multi-threaded Mandelbrot set generator slower than single thread
I am new to parallel programming. I have been playing around with multi-threading and for some reason, multi-threading the Mandelbrot set is slower than running a single thread. I have been trying to ...
2votes
2answers
323views
Event Dispatcher for GLFW/Glad
I've tried to write an event dispatcher for a GLFW/Glad library. However I am not very used to writing efficient code (spent the majority of my life writing in C# and performance was never really the ...
2votes
1answer
124views
C++ allocator for std::wstring_convert
In my application, I'm using std::wstring_convert to convert std::string into std::u32string....
0votes
1answer
72views
Enter the randomly displayed letter console game
The below code segments compose a simple console game where the user is prompted to enter a randomly generated letter displayed in the console. It also saves and loads user data through a .txt file. ...
2votes
0answers
150views
Improving constexpr invoke function C++17, alternative to std::invoke
I've learned that in C++17, std::invoke isn't constexpr. To make a constexpr version, I could copy the implementation provided here: https://en.cppreference.com/w/cpp/utility/functional/invoke , OR I ...
0votes
0answers
414views
Skyscraper Solver for NxN Size Version 4
This is a follow up of Skyscraper Solver for NxN Size Version 3 I know its getting old... So I still have the same Issue the code is to slow to solve bigger skyscraper puzzles. Since the last Version ...
1vote
1answer
216views
Skyscraper Solver for NxN Size Version 3 (Using Bitmasks)
This is a follow up of Skyscraper Solver for NxN Size Version 2 (Using Backtracking) I followed the advice in the last Codereview and did the following optimizations: Implementation of the class <...
1vote
1answer
2kviews
Skyscraper Solver for NxN Size Version 2 (Using Backtracking)
This is a follow up of Skyscraper Solver for NxN Size I followed the advice in the last question and changed my approach from generating Permutations to use Backtracking to solve the puzzle. ...
3votes
1answer
14kviews
Skyscraper Solver for NxN Size
I try to solve a kata on codewars which let you write a skyscraper solver for skyscrapers up to size 11x11. Basic Example what is a skyscraper puzzle (here with 4by4 but the principle stays the same): ...
14votes
3answers
7kviews
C++ Fast Fourier transform
This is a very simple FFT, I am wondering what I can do to make this faster and more memory efficient from the programming side (better data types, and maybe some tricks like unrolling loops or using ...